package com.zzqstart.cateservice.controller.front;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zzqstart.cateservice.entity.CateCategory;
import com.zzqstart.cateservice.entity.vo.OneCategoryVo;
import com.zzqstart.cateservice.service.CateCategoryService;
import com.zzqstart.commonutils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * ClassName: CategoryFrontController
 * Package: com.zzqstart.cateservice.controller.front
 * Description:
 *
 * @Author zzqstart
 * @Create 2023-03-07 14:08
 * @Version 1.0
 */
@Api(tags = "前台菜谱分类数据")
@RestController
@RequestMapping("/cateservice/category/front")
public class CategoryFrontController {
    @Autowired
    private CateCategoryService cateCategoryService;

    @ApiOperation(value = "获取分类树形结构信息")
    @GetMapping("/getAllCategory")
    public R getAllCategoryTree() {
        List<OneCategoryVo> list = cateCategoryService.getAllCategoryTree();
        return R.ok().data("list",list);
    }

}
